#include "DictionaryProducer.h"
#include "Configuration.h"

int main(void) {
    Configuration conf;
    cppjieba::Jieba jieba(conf.DICT_PATH, conf.HMM_PATH, conf.USER_DICT_PATH, conf.IDF_PATH, conf.STOP_WORD_PATH);

    DictionaryProducer dictionary("/home/chizuru/search-engines/data-corpus/corpus", &jieba);

//    TODO 此步可省略，把停用词放入jieba的停用词里
    printf("创建停用词\n");
    dictionary.setStopWord("/home/chizuru/search-engines/data-corpus/stop_words.txt");

    printf("创建字典\n");
    dictionary.buildDict();

    printf("创建索引\n");
    dictionary.createIndex();

    printf("保存字典\n");
    dictionary.storeDict("/home/chizuru/search-engines/data/dict.dat");
    printf("保存索引\n");
    dictionary.storeIndex("/home/chizuru/search-engines/data/dictIndex.dat");
    return 0;
}


